<!doctype html>
<html lang="zh-CN" prefix="og: http://ogp.me/ns#" class="no-js">
<head>
    <meta charset="UTF-8">
    <title>
        荷兰库拉索移民中心-{{ !empty($details) ? $details['title'] : '同性婚姻注册自由地' }}
    </title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel='stylesheet' id='nfiacss-css' href='{{ asset('static/css/styles.css')}}' media='all'/>
    <link rel="stylesheet" href="{{ mix('css/new.css') }}">
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_432596_nl7en5w2mo.css">
</head>
<body class="post-template-default single single-post postid-9224 single-format-standard admin-bar tribe-no-js">
<div class="wrapper animsition" id="wrapper">
    @include('head')
    <div class="marquee retina-img" data-image-lg="/images/new/news-banner.png"
         data-image-md="/images/new/news-banner.png" data-image-sm="/images/new/news-banner.png">
        <span class="fb-banner-text">新闻中心</span>
    </div>

    <div class="container">
        <div class="fb-news">
            <?php if (!empty($data)): ?>
            <?php foreach ($data as $vv): ?>
            <div class="fb-news-item">
                <div class="fb-news-item-left fl">
                    <img src="<?php echo $vv['img'] ?>" alt=""/>
                    <div class="fb-date">
                        <i class="iconfont icon-bookmark"></i>
                        <div class="date">
                            <span><?php echo $vv['day']?></span>
                            <b><?php echo $vv['year']?>/<?php echo $vv['month']?></b>
                        </div>
                    </div>
                </div>
                <div class="fb-news-item-right fr">
                    <h4><?php echo $vv['title']; ?></h4>
                    <div class="fb-news-summary">
                        <?php echo $vv['summary']; ?>
                    </div>
                    <div class="fb-view-more">
                        <a href="/news/detail?id=<?php echo $vv['id'];?>" target="_blank">VIEW MORE</a> <i
                                class="iconfont icon-fangdajing"></i>
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
            <?php endforeach; ?>
            <?php endif; ?>


        </div>


        <div class="fb-load-more">
            <?php if($current_page < $total_page) :?>
            <a data-page="1" class="pagebtn" href="?fpage=<?php echo $current_page + 1;?>">

                <span>加载更多 +</span></a>
            <?php endif;?>
        </div>
    </div>

</div>
@include('tool')
@include('footer')
</body>

</html>
<script type='text/javascript' src='{{ asset('static/jquery/jquery.js') }}'></script>
<script type='text/javascript' src='{{ asset('static/jquery/themes/scripts.min.js') }}'></script>
<script>
  $(function () {
    nextpage('.fb-load-more', '.pagebtn', '.fb-news', '.fb-news-item');

    /* 下一页 */
    function nextpage(parent, btn, target, item, limited) {
      $(parent).on('click', btn, function () {
        var obj = $(this),
          page = obj.attr('data-page');

        if (!obj.hasClass('disabled')) {
          if (typeof limited == 'string' && limited == 'false') {
            loadMore(btn, target, item, page, 'false');
          } else {
            loadMore(btn, target, item, page);
          }
        }

        return false;
      });
    }

    /* 加载更多 */
    function loadMore(btn, target, item, page, limited) {
      var newpage = $(btn).attr('href'),
        defaultTxt = $(btn).text();

      $.ajax({
        url: newpage,
        dataType: 'html',
        beforeSend: function () {
          $(btn).hide();
          $(btn).after('<i class="iconfont icon-spinner animate-spin"></i>');
        }
      }).done(function (data) {
        var wrappedObj = $('<div id="tempwrap"></div>').html(data);

        if ($(item, wrappedObj).length <= 0) {
          $(btn).parent().hide();
        } else {
          $(target).append($(target, wrappedObj).html());
          if (typeof $(btn, wrappedObj).attr('href') != 'undefined') {
            $(btn).siblings().hide();
            $(btn).show();
            $(btn).attr('href', $(btn, wrappedObj).attr('href'));
            $(btn).attr('data-page', $(btn, wrappedObj).attr('data-page'));
          } else {
            $(btn).parent().hide();
          }
        }
      });
    }

  })
</script>